import os
import unittest
from langchain_community.chat_models import ChatOpenAI


def testOpen():
    llm = ChatOpenAI(model_name='gpt-3.5-turbo',temperature=0.5, openai_api_key=os.environ.get('OPENAI_API_KEY'),
                 base_url='https://api.chatanywhere.tech/v1')
    response = llm.invoke('谁是中国改革开放的总设计师？')
    print(response, type(response))

class MyTestCase(unittest.TestCase):
    def test_something(self):
        testOpen()  # add assertion here


if __name__ == '__main__':
    unittest.main()
